home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / stdexcep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  6.3 KB  |  247 lines

  1. /* This file is included specially and does not have a normal header guard */
  2. #pragma option push -b -a4 -Vx- -Ve- -w-inl -w-aus -w-sig
  3. #ifndef __STD_STDEXCEPT
  4.  
  5. /***************************************************************************
  6.  *
  7.  * stdexcept - declarations for the Standard Library standard exception class
  8.  *
  9.  * $Id: stdexcept,v 1.41 1996/08/28 01:31:01 smithey Exp $
  10.  *
  11.  ***************************************************************************
  12.  *
  13.  * (c) Copyright 1994, 1995 Rogue Wave Software, Inc.
  14.  * ALL RIGHTS RESERVED *
  15.  * The software and information contained herein are proprietary to, and
  16.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  17.  * intends to preserve as trade secrets such software and information.
  18.  * This software is furnished pursuant to a written license agreement and
  19.  * may be used, copied, transmitted, and stored only in accordance with
  20.  * the terms of such license and with the inclusion of the above copyright
  21.  * notice.  This software and information or any other copies thereof may
  22.  * not be provided or otherwise made available to any other person.
  23.  *
  24.  * Notwithstanding any other lease or license that may pertain to, or
  25.  * accompany the delivery of, this computer software and information, the
  26.  * rights of the Government regarding its use, reproduction and disclosure
  27.  * are as set forth in Section 52.227-19 of the FARS Computer
  28.  * Software-Restricted Rights clause.
  29.  *
  30.  * Use, duplication, or disclosure by the Government is subject to
  31.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  32.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  33.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  34.  * P.O. Box 2328, Corvallis, Oregon 97339.
  35.  *
  36.  * This computer software and information is distributed with "restricted
  37.  * rights."  Use, duplication or disclosure is subject to restrictions as
  38.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  39.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  40.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  41.  * then the "Alternate III" clause applies.
  42.  *
  43.  **************************************************************************/
  44.  
  45. #include <stdcomp.h>
  46.  
  47. #ifndef _RWSTD_HEADER_REQUIRES_HPP
  48. #include <string>
  49. #else
  50. #include <string.hpp>
  51. #endif
  52.  
  53. #ifndef __RWSTD_EXCEPT_SEEN
  54. #ifndef _RWSTD_HEADER_REQUIRES_HPP
  55. #include <exception>
  56. #else
  57. #include <exception.hpp>
  58. #endif
  59.  
  60. #ifndef _RWSTD_NO_NAMESPACE
  61. namespace std {
  62. #endif
  63.  
  64. // MSVC provides its own exception class and logic_error class.
  65. // In order to allow the use of MSVC classes derived from these
  66. // We have to use them to, instead of our own.  The drawback is
  67. // that we don't have a logic_error(const string&) constructor any
  68. // more.  Now we have a logic_error(const char *) constructor.
  69. #ifndef _RWSTD_LOGIC_ERROR_DEFINED
  70. class _RWSTDExport logic_error : public exception
  71. {
  72.   public:
  73.     logic_error (const string& what_arg)  _RWSTD_THROW_SPEC_NULL
  74.       : str_(what_arg)
  75.     { ; }
  76.  
  77.     virtual ~logic_error ()  _RWSTD_THROW_SPEC_NULL
  78. #ifndef HPPA_WA
  79.     { ; }
  80. #else
  81.     ;
  82. #endif 
  83.  
  84.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  85.     {
  86.         return str_.data();
  87.     }
  88.  
  89.   private:
  90.     string str_;
  91. };
  92. #endif
  93.  
  94. class _RWSTDExport domain_error : public logic_error
  95. {
  96.   public:
  97.     domain_error (const string& what_arg) _RWSTD_THROW_SPEC_NULL 
  98. #ifndef _RWSTD_LOGIC_ERROR_DEFINED
  99.       : logic_error(what_arg) {;}
  100. #else
  101.       : logic_error(what_arg.c_str()) {;}
  102. #endif
  103.  
  104.     virtual ~domain_error ()  _RWSTD_THROW_SPEC_NULL
  105. #ifndef HPPA_WA
  106.     { ; }  
  107. #else
  108.     ;
  109. #endif 
  110. };
  111.  
  112. class _RWSTDExport invalid_argument : public logic_error
  113. {
  114.   public:
  115.     invalid_argument (const string& what_arg) _RWSTD_THROW_SPEC_NULL 
  116. #ifndef  _RWSTD_LOGIC_ERROR_DEFINED
  117.       : logic_error(what_arg) {;}
  118. #else
  119.       : logic_error(what_arg.c_str()) {;}
  120. #endif
  121.  
  122.     virtual ~invalid_argument ()  _RWSTD_THROW_SPEC_NULL
  123. #ifndef HPPA_WA
  124.     { ; }  
  125. #else
  126.     ;
  127. #endif
  128. };
  129.  
  130. class _RWSTDExport length_error : public logic_error
  131. {
  132.   public:
  133.     length_error (const string& what_arg) _RWSTD_THROW_SPEC_NULL 
  134. #ifndef  _RWSTD_LOGIC_ERROR_DEFINED
  135.       : logic_error(what_arg) {;}
  136. #else
  137.       : logic_error(what_arg.c_str()) {;}
  138. #endif
  139.  
  140.     virtual ~length_error ()  _RWSTD_THROW_SPEC_NULL
  141. #ifndef HPPA_WA
  142.     { ; }
  143. #else
  144.     ;
  145. #endif
  146. };
  147.  
  148. class _RWSTDExport out_of_range : public logic_error
  149. {
  150.   public:
  151.     out_of_range (const string& what_arg) _RWSTD_THROW_SPEC_NULL 
  152. #ifndef  _RWSTD_LOGIC_ERROR_DEFINED
  153.       : logic_error(what_arg) {;}
  154. #else
  155.       : logic_error(what_arg.c_str()) {;}
  156. #endif
  157.  
  158.     virtual ~out_of_range ()  _RWSTD_THROW_SPEC_NULL
  159. #ifndef HPPA_WA
  160.     { ; }  
  161. #else
  162.     ;
  163. #endif
  164. };
  165.  
  166. class _RWSTDExport runtime_error : public exception
  167. {
  168.   public:
  169.     runtime_error (const string& what_arg) _RWSTD_THROW_SPEC_NULL  
  170.       : str_(what_arg)
  171.     { ; }
  172.  
  173.     virtual ~runtime_error ()  _RWSTD_THROW_SPEC_NULL
  174. #ifndef HPPA_WA
  175.     { ; }  
  176. #else
  177.     ;
  178. #endif
  179.  
  180.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  181.     {
  182.         return str_.data();
  183.     }
  184.  
  185.   private:
  186.     string str_;
  187. };
  188.  
  189. class _RWSTDExport range_error : public runtime_error
  190. {
  191.   public:
  192.     range_error (const string& what_arg) _RWSTD_THROW_SPEC_NULL 
  193.       : runtime_error(what_arg) {;}
  194.  
  195.     virtual ~range_error ()  _RWSTD_THROW_SPEC_NULL
  196. #ifndef HPPA_WA
  197.     { ; }  
  198. #else
  199.     ;
  200. #endif
  201. };
  202.  
  203. class _RWSTDExport overflow_error : public runtime_error
  204. {
  205.   public:
  206.     overflow_error (const string& what_arg) _RWSTD_THROW_SPEC_NULL 
  207.       : runtime_error(what_arg) {;}
  208.  
  209.     virtual ~overflow_error ()  _RWSTD_THROW_SPEC_NULL
  210. #ifndef HPPA_WA
  211.     { ; }  
  212. #else
  213.     ;
  214. #endif
  215. };
  216.  
  217. class _RWSTDExport underflow_error : public runtime_error
  218. {
  219.   public:
  220.     underflow_error (const string& what_arg) _RWSTD_THROW_SPEC_NULL 
  221.       : runtime_error(what_arg) {;}
  222.  
  223.     virtual ~underflow_error ()  _RWSTD_THROW_SPEC_NULL
  224. #ifndef HPPA_WA
  225.     { ; }  
  226. #else
  227.     ;
  228. #endif
  229. };
  230.  
  231. #define __RWSTD_EXCEPT_SEEN
  232.  
  233. #ifndef _RWSTD_NO_NAMESPACE 
  234. #endif
  235.  
  236. #endif /*__RWSTD_EXCEPT_SEEN*/
  237.  
  238. //
  239. // Yes, the complete file has been processed!
  240. //
  241. #define __STD_STDEXCEPT
  242.  
  243. #endif /*__STD_STDEXCEPT*/
  244.  
  245. #pragma option pop
  246.